package ru.myrtle.umf.codegen;

import java.io.File;

public class ResourceSet {

    private final File destination;
    private final String suffix;

    public ResourceSet(File destination, String suffix) {
        this.destination = destination;
        this.suffix = suffix;
    }

    public File getDestination() {
        return destination;
    }

    public String getSuffix() {
        return suffix;
    }

    public ResourceDomain getDomain(String name) {
        String directory = name;

        if (suffix != null) {
            directory += "-" + suffix;
        }

        File directoryFile = new File(
                destination, directory
        );

        directoryFile.mkdirs();

        return new ResourceDomain(directoryFile);
    }
}
